<div class="form">
    
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'dispatchdetails-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
        
        
	<div class="row">
		<?php echo $form->labelEx($model,'dispatch'); ?>
            <div class="model-data">
                <?php echo $model->dispatch; ?>
            </div>
		
                <?php echo $form->hiddenField($model,'dispatch');?>
		<?php echo $form->error($model,'dispatch'); ?>
	</div>
        
        <?php echo $form->hiddenField($model,'custno');?>
        <?php echo $form->hiddenField($model,'locno');?>
        
        <div class="row">
		<?php echo $form->labelEx($model,'calledinby'); ?>
		<?php echo $form->textField($model,'calledinby',array('size'=>25,'maxlength'=>25)); ?>
		<?php echo $form->error($model,'calledinby'); ?>
	</div>
        
        <div class="row">
		<?php echo $form->labelEx($model,'department'); ?>
		<?php echo $form->dropDownList($model,'department',$model->getDepartmentList()); ?>
		<?php echo $form->error($model,'department'); ?>
	</div>
       

	<div class="row">
		<?php echo $form->labelEx($model,'priority'); ?>
		<?php echo $form->dropDownList($model,'priority',$model->getPriorityList()); ?>
		<?php echo $form->error($model,'priority'); ?>
	</div>

	
        <div class="row">
		<?php echo $form->labelEx($model,'receivedby'); ?>
            <div class="model-data">
                <?php echo $model->receivedby;?>
            </div>
		
		<?php echo $form->error($model,'receivedby'); ?>
	</div>
        
	<div class="row">
		<?php echo $form->labelEx($model,'receiveddate'); ?>
		<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
                    'model'=>$model,
                    'attribute'=>'receiveddate',
                    'value'=>CTimestamp::formatDate('m-d-Y',$model->receiveddate),
                    'options' => array('receiveddate'=>'m-d-yy'),
                )); ?>
		<?php echo $form->error($model,'dateofnote'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'receivedtime'); ?>
		<?php $this->widget('CMaskedTextField',array(
                    'model'=>$model,
                    'attribute'=>'receivedtime',
                    'mask'=>'99:99:99',
                    'htmlOptions'=>array(
                        'size'=>6
                    )
                ));?>
		<?php echo $form->error($model,'receivedtime'); ?>
	</div>

	

	
        <div class="row">
		<?php echo $form->labelEx($model,'ponumber'); ?>
		<?php echo $form->textField($model,'ponumber',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'ponumber'); ?>
	</div>
        
	


	<div class="row">
		<?php echo $form->labelEx($model,'jobnumber'); ?>
		<?php echo $form->dropDownList($model,'jobnumber',array()); ?>
		<?php echo $form->error($model,'jobnumber'); ?>
	</div>
        <div class="row">
		<?php echo $form->labelEx($model,'invoice'); ?>
		<?php echo $form->textField($model,'invoice',array('size'=>10,'maxlength'=>10)); ?>
		<?php echo $form->error($model,'invoice'); ?>
	</div>
	

        
        <div class="row">
          
		<?php echo $form->labelEx($model,'notes'); ?>
		
            <div class="model-data">
                <a href="javascript:void(0);" onclick="insertAtCaret('Dispatchdetails_notes',getDate()+' ');">Insert time</a>
                <?php echo $form->textArea($model,'notes',array('rows'=>6, 'cols'=>50)); ?>
            </div>
		<?php echo $form->error($model,'notes'); ?>
	</div>
	<div class="row_buttons">
		<?php echo CHtml::submitButton('Update'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->